import * as mongoose from 'mongoose';

/**
 *  schema 可以看作是 列属性的构架，对应着 mongodb中 ‘field’ （数据字段）的概念，默认 有 ‘_id’
 */

export const ContactSchema = new mongoose.Schema({
    firstName: {
        type: String,
        required: 'Enter a first name'
    },
    lastName: {
        type: String,
        required: 'Enter a last name'
    },
    email: {
        type: String
    },
    company: {
        type: String
    },
    phone: {
        type: Number
    },
    created_date: {
        type: Date,
        default: Date.now
    }
});
